package cn.jilian.meta.handler.generators;

import java.util.Map;

import cn.jilian.entity.Meta;
import cn.jilian.meta.handler.CompGenerator;
import cn.jilian.meta.handler.GeneratorManager;
import cn.jilian.meta.handler.domain.Model;
import cn.jilian.meta.handler.domain.TreePanel;
import cn.jilian.meta.handler.domain.TreeStore;

public class SimpleTreePanelGenerator implements CompGenerator<TreePanel> {

	private GeneratorManager manager;
	private CompGenerator<Model> modelGenrator;
	private CompGenerator<TreeStore> storeGenerator;
	public SimpleTreePanelGenerator(GeneratorManager manager) {
		this.manager=manager;
		this.storeGenerator=manager.getGenerator(TreeStore.class);
		this.modelGenrator=manager.getGenerator(Model.class);	
	}
	
	@Override
	public TreePanel convert(Meta meta, Map<String, Object> extConfig) {
		TreePanel treePanel=new TreePanel();
		TreeStore store=storeGenerator.convert(meta, null);
		treePanel.setStore(store);
		if(extConfig!=null) {
			if(extConfig.containsKey("actions")) {
				
			}
		}
		return treePanel;
	}

}
